server{
	listen 80;
	autoindex on;
	server_name ${domain} www.${domain};
	index index.html index htm index.jsp index.php;
	#error_page 404 /404.html;
	if ($host != "www.${domain}") {
		# return 200 $host;
		rewrite ^/(.*)$ http://www.${domain} permanent;
	}
	if ( $query_string ~* ".*[\;'\<\>].*" ){
		return 404;
	}
	location /{
		
		#add_header Access-Control-Allow-Origin *;
		proxy_set_header Host $http_host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
		
		proxy_pass http://127.0.0.1:${port};    # proxy_pass 表示转发到端口
		
	}
	access_log  /www/wwwlogs/${domain}.log;
	error_log  /www/wwwlogs/${domain}.error.log;
}